package org.zero.cloud.producer.controller;

import org.springframework.web.bind.annotation.*;
import org.zero.producer.api.ProducerClient;

/**
 * @author yezhaoxing
 * @date 2020/3/16
 */
@RestController
public class ProducerController implements ProducerClient {

    @Override
    public String consumer(@RequestParam(value = "name") String name) {
        System.out.println("收到请求:" + name);
        /*if (System.currentTimeMillis() % 2 == 0) {
            throw new RuntimeException("服务异常");
        }*/
        try {
            Thread.sleep(10);
        } catch (Exception ex) {

        }
        System.out.println(name);
        return name;
    }
}
